<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>7.jQuery封装的jsonp</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>

<body>
    <button onclick="getStudents()">获取学生数据</button>

    <script type="text/javascript">
        function getStudents() {
            $.getJSON('http://127.0.0.1:8080/teachers?callback=?', (data)=>{
                console.log(data);
            })
        }
    </script>
</body>

</html>